# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=ktoblzcheck
pkgver=1.55
pkgrel=1
pkgdesc="A library to check account numbers and bank codes of german banks"
url="https://ktoblzcheck.sourceforge.net/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="cmake python3 python3-dev py3-openpyxl sqlite-dev curl-dev"
subpackages="$pkgname-dev $pkgname-doc"
options="net"
source="https://downloads.sourceforge.net/sourceforge/ktoblzcheck/ktoblzcheck-$pkgver.tar.gz
	0001-Use-cmake_path-over-get_filename_component.patch
	fix-tests.patch"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_BANKDATA_DOWNLOAD=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1d8d54172ac02ae8562cbefeacce12229777e5fbd11bbbd71ba952c9a31a2f68ac56a30891fd75db2ee880d1c92a14271a4b07314726013b827b9d4ac7281b87  ktoblzcheck-1.55.tar.gz
c416e07c236fc2210ea6aea4cf8c1d638e06009a6b1c97d7de71e6775aab582575bc05418ff5df9d6f6c30225be26b09fef6997c80d7269cf0a1691b3b5032f6  0001-Use-cmake_path-over-get_filename_component.patch
b3ea1c3e45da10682ff62f8547246c042c750eb1103e48d56c2965f8e3ff842444eedd73bbd0dc32817c5eb5c674a4faae5e24e6ae6794d753b51476c28ff255  fix-tests.patch
"
